Longest Consecutive Sequence Leetcode 128 Javascript